package cn.hxzy.controller;

import cn.hxzy.domain.FileInfo;
import cn.hxzy.response.R;
import cn.hxzy.response.StatusEnum;
import cn.hxzy.service.FileInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/FileInfo")
public class FileInfoController {
    @Autowired
    private FileInfoService fileInfoService;

    @PostMapping("/saveFile")
    public R saveFile(@RequestBody FileInfo fileInfo) {
        int i = fileInfoService.insertFileInfo(fileInfo);
        if (i>0){
            return R.success(i);
        }
        return R.error(StatusEnum.PARAM_INVALID);
    }
}
